<template>
	<view>
		<view class="address_item" v-for="(item,index) in addresslist" :key="index">
			<view class="" @click="choise_address(item)">
				<text>{{item.name}} - </text>
				<text class="address_text">{{item.address}}</text>
			</view>

		</view>
	</view>
</template>

<script>
	import {mapMutations} from 'vuex'
	export default {
		data() {
			return {
				addresslist: [{
						name: 'molu',
						address: '湖北省武汉市123'
					},
					{
						name: 'hzf',
						address: '湖北省鄂州'
					},
					{
						name: 'IKUN',
						address: '北京朝阳吴亦凡隔壁'
					},
				]
			};
		},
		methods: {
			...mapMutations('M_address',['updateAddress']),
			
			choise_address(item) {
				this.updateAddress(item)
				// uni.setStorageSync('address',item)
				
				uni.switchTab({
					url: `../../pages/cart/cart`

				})

			}
		}
	}
</script>

<style lang="scss">
	.address_item {

		display: flex;
		justify-content: space-between;
		padding: 10rpx;

		.address_text {
			padding-right: 80rpx;
		}

	}
</style>